<?php
/**
 * Created by PhpStorm.
 * User: shiyi
 * Date: 2018/6/8
 * Time: 18:45
 */
namespace app\api\controller;


class Base{
    public function formatData($data, $count){
        count($data)>0?  ($code=0) . ($msg='success') : ($code=400) . ($msg='failed');
        return [
            'code'=> $code,
            'msg'=> $msg,
            'count'=>$count,
            'data'=>$data
        ];
    }
}